package com.example.demo.cloud.producer.rest;

import com.example.demo.client.client.HelloClient;
import com.example.demo.common.exception.DemoException;
import com.example.demo.common.vo.ResponseVo;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author root
 * @date 2021-01-08 10:52
 */
@RestController
public class HelloRest implements HelloClient {
    @Override
    public String say(String name) {

        return null;
    }

    @Override
    public String see(String name, String token) {
        return null;
    }

    @Override
    public String look(String name) {
        return null;
    }

    @Override
    public ResponseVo<String> getList(Integer code) {
        if(code % 2 == 0) {
            throw new DemoException("错误");
        }
        return ResponseVo.success("成功");
    }

    @Override
    public String getList1(Integer code) {
        if(code % 2 == 0) {
            throw new DemoException("list1错误");
        }
        return "list1成功";
    }
}
